package nl.gamayun.whohasit.utils;

import java.util.Calendar;

import nl.gamayun.whohasit.utils.DurationFormat;
import android.test.AndroidTestCase;

public class DurationFormatTest extends AndroidTestCase {
	
	@Override
	protected void setUp() throws Exception
	{
		super.setUp();
	}
	
	public void testGetDurationTillTodayBig()
	{
		Calendar calendar = Calendar.getInstance();
		calendar.add(Calendar.DAY_OF_YEAR, -1);
		String expectedResult = "For: 1 Day";
		String result = DurationFormat.getDurationTillTodayBig(calendar);
		assertEquals(expectedResult, result);

	}

	public void testGetDurationFromTodayBig()
	{
		Calendar calendar = Calendar.getInstance();
		calendar.add(Calendar.DAY_OF_YEAR, 1);
		String expectedResult = "Due: 1 Day";
		String result = DurationFormat.getDurationFromTodayBig(calendar);
		assertEquals(expectedResult, result);

	}

	public void testGetDurationTillTodaySmall()
	{
		Calendar calendar = Calendar.getInstance();
		calendar.add(Calendar.DAY_OF_YEAR, -1);
		String expectedResult = "For: 1D";
		String result = DurationFormat.getDurationTillTodaySmall(calendar);
		assertEquals(expectedResult, result);

	}

	public void testGetDurationFromTodaySmall()
	{
		Calendar calendar = Calendar.getInstance();
		calendar.add(Calendar.DAY_OF_YEAR, 1);
		String expectedResult = "Due: 1D";
		String result = DurationFormat.getDurationFromTodaySmall(calendar);
		assertEquals(expectedResult, result);

	}

}
